import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    children:[
      {
        path: '/home',
        name: 'Main',
        component: () => import('../views/Main.vue')
      },
      {
        path: '/home/shopcart',
        name: 'ShopCart',
        component: () => import('../views/ShopCart.vue')
      },
      {
        path: '/home/order',
        name: 'order',
        component: () => import('../views/order.vue')
      },
      {
        path: '/home/mine',
        name: 'Mine',
        component: () => import('../views/Mine.vue')
      },
    ]
  },
  {
    path: '/ConOrder',
    name: 'ConOrder',
    component: () => import('../views/ConOrder.vue')
  },
  {
    path: '/SubOrder',
    name: 'SubOrder',
    component: () => import('../views/SubOrder.vue')
  },
  {
    path: '/PayOrder',
    name: 'PayOrder',
    component: () => import('../views/PayOrder.vue')
  },
  {
    path: '/',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/Address',
    name: 'adddress',
    component: () => import('../views/Address.vue')
  },
  {
    path: '/Addaddress',
    name: 'addaddress',
    component: () => import('../views/Addaddress.vue')
  },
  {
    path: '/EditAddress',
    name: 'editaddress',
    component: () => import('../views/EditAddress.vue')
  },
  {
    path: '/ProductDel',
    name: 'productDel',
    component: () => import('../views/ProductDel.vue')
  },
  {
    path: '/Productnull',
    name: 'Productnull',
    component: () => import('../views/Productnull.vue')
  },
  {
    path: '/ProductMask',
    name: 'ProductMask',
    component: () => import('../views/ProductMask.vue')
  },
  {
    path: '/Search',
    name: 'Search',
    component: () => import('../views/Search.vue')
  },
  {
    path: '/Searesult',
    name: 'Searesult',
    component: () => import('../views/Searesult.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
